<meta charset="utf-8" />
<title>伯坦科技</title>
<meta content="width=device-width, height=device-height, initial-scale=1.0" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<link rel="shortcut icon" href="<@spring.url '/static/images/icon_btkj.png'></@spring.url>">


<script src="<@spring.url '/static/lib/jquery/1.12.4/jquery.min.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/jquery/1.12.4/jquery-migrate-1.2.1.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/bootstrap-3.3.5/js/bootstrap.min.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/bignumber.min.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/jquery.pagination.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/jquery.validate.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/jquery.md5.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/jquery.form.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/common.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/commonutil.js'></@spring.url>"></script>
<script src="<@spring.url '/static/js/mathutil.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/timePicker/WdatePicker/WdatePicker.js'></@spring.url>"></script>
 
<script src="<@spring.url '/static/lib/jquery.multiselect/jquery-ui.min.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/jquery.multiselect/jquery.multiselect.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/jquery.chosen/jquery.chosen.min.js'></@spring.url>"></script>
 
<script src="<@spring.url '/static/lib/showloading/jquery.showLoading.min.js'></@spring.url>"></script>
<script src="<@spring.url '/static/lib/dialog/jquery.alerts.js'></@spring.url>"></script>

<script src="<@spring.url '/static/lib/jquery.PrintArea/jquery.PrintArea.js'></@spring.url>"></script>

<script src="<@spring.url '/static/lib/jquery.qrcode/jquery.qrcode.min.js'></@spring.url>"></script>
 

<script src="${base}/static/js/jquery.blockui.min.js"></script>
<script src="${base}/static/js/jquery.nestable.js"></script>
<script src="${base}/static/js/ui-nestable.js"></script>
<script src="${base}/static/js/app.js"></script>

 
<!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->






<script>
	var CONTEXT='${base}';
	
    $.validator.setDefaults({
    	errorElement:'span'
    });
    
	$(document).ajaxComplete(function(event, xhr, settings) {
	    //从http头信息取出 在filter定义的sessionstatus，判断是否是 timeout
	    if(xhr.getResponseHeader!=null){
	    
	       if( xhr.getResponseHeader("sessionstatus")=="timeout"){ 
		        //从http头信息取出登录的url ＝ loginPath
		        if(xhr.getResponseHeader("loginPath")){
		             jAlert("会话过期，请重新登陆!","提示",function(){
			             //打会到登录页面
			             window.location.replace(xhr.getResponseHeader("loginPath"));  
		             }); 
		            
		        }else{  
		            jAlert("请求超时请重新登陆 !","提示");
		        }  
	       }  
	    
	    }

	}); 
	
	
 
	function combox(comboxid,name,parentidStr,selectidStr,multiple){
 
		$.ajax({  
		      type : "POST",  
		      url : CONTEXT+'/selectByComboCategory?name='+name+'&parentidStr='+parentidStr+'&selectidStr='+selectidStr+'&multiple='+multiple,  
		      dataType : "json",  
		      cache : false,  
		      async : false,  
		      success : function(data) {  
		    	  
		    	  var  optionStr="";
		    	  
		    	  if(multiple==false){
		    		  
		    		  optionStr =  "<option value=''>===请选择===</option>";  
			          for (var i = 0; i < data.length; i++) {  
		        		  optionStr +=  "<option value="+data[i].key+">"+data[i].value+"</option>";  
			          }  
		          
		    	  }else{
		    		 
		              for (var i = 0; i < data.length; i++) {  
		            	
		        		  for (var j = 0; j < data[i].length; j++) {  
		        			  
		        			  var data2= data[i];
		        			  
		        			  if(j==0){
		        				  optionStr += "<optgroup label='"+data2[j].value+"'>"; 
		        			  }else{
		        				  optionStr +=  "<option value="+data2[j].key+">"+data2[j].value+"</option>";  
		        			  }
		        			  
		        			  if(j== data[i].length-1){
		        				  optionStr += "</optgroup>"; 
		        			  }
		        		  }
		        		 
		              }  
	        	  }
		          $("#"+comboxid).html(optionStr);  
		      }  
		  }); 
	}
	
  
    function getOptionsFromForm()
    {
        var opt = {callback: pageselectCallback};
        opt['items_per_page'] = 15;
        opt['num_display_entries'] = 10;
        opt['num'] = 2;
        opt['prev_text'] = '上一页';
        opt['next_text'] = '下一页';
        opt['current_page'] = curent_page;
        return opt;
    }
    
    function pageselectCallback(page_index, jq)
    {
        if (curent_page != page_index)
        {
            $("#currentpage").val(page_index);
            $("#searchform").submit();
            return true;
        }
    }
    
    function getCheckedIds(){
    	
    	var ids="";
    	$(".list-checkbox").each(function(){
    	  
    	    if(this.checked){
    	    	ids=ids+$(this).val()+",";
    	    }
    	});  
    	
    	if(ids!=""){
    		ids=ids.substr(0,ids.length-1);
    	}
    	
    	return ids;
    }
	
    
  //http://www.51xuediannao.com/js/jquery/jquery_validate/
  //配置错误提示的节点，默认为label，这里配置成 span （errorElement:'span'）
    $.validator.setDefaults({
    	errorElement:'span'
    });
    
  //配置通用的默认提示语
    $.extend($.validator.messages, {
    	required: '必填',
        equalTo: "请再次输入相同的值"
    });
    //登录名
    jQuery.validator.addMethod("loginname", function (value, element) {
    	var loginname = /^[0-9a-zA-Z_]+$/;
    	return this.optional(element) || (loginname.test(value));
    }, "登录名只能为数字,字母,下划线");
  //邮箱 
    jQuery.validator.addMethod("email", function (value, element) {
    	var mail = /^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$/;
    	return this.optional(element) || (mail.test(value));
    }, "邮箱格式不对");

    //电话验证规则
    jQuery.validator.addMethod("phone", function (value, element) {
        var phone = /^0\d{2,3}-\d{7,8}$/;
        return this.optional(element) || (phone.test(value));
    }, "电话格式如：0371-68787027");

    //区号验证规则  
    jQuery.validator.addMethod("ac", function (value, element) {
        var ac = /^0\d{2,3}$/;
        return this.optional(element) || (ac.test(value));
    }, "区号如：010或0371");

    //无区号电话验证规则  
    jQuery.validator.addMethod("noactel", function (value, element) {
        var noactel = /^\d{7,8}$/;
        return this.optional(element) || (noactel.test(value));
    }, "电话格式如：68787027");

    //手机验证规则  
    jQuery.validator.addMethod("mobile", function (value, element) {
        var mobile = /^1[3|4|5|7|8]\d{9}$/;
    	return this.optional(element) || (mobile.test(value));
    }, "手机格式不对");

    //邮箱或手机验证规则  
    jQuery.validator.addMethod("mm", function (value, element) {
        var mm = /^[a-z0-9._%-]+@([a-z0-9-]+\.)+[a-z]{2,4}$|^1[3|4|5|7|8]\d{9}$/;
    	return this.optional(element) || (mm.test(value));
    }, "格式不对");

    //电话或手机验证规则  
    jQuery.validator.addMethod("tm", function (value, element) {
        var tm=/(^1[3|4|5|7|8]\d{9}$)|(^\d{3,4}-\d{7,8}$)|(^\d{7,8}$)|(^\d{3,4}-\d{7,8}-\d{1,4}$)|(^\d{7,8}-\d{1,4}$)/;
        return this.optional(element) || (tm.test(value));
    }, "格式不对");

    //年龄
    jQuery.validator.addMethod("age", function(value, element) {   
    	var age = /^(?:[1-9][0-9]?|1[01][0-9]|120)$/;
    	return this.optional(element) || (age.test(value));
    }, "不能超过120岁"); 
    ///// 20-60   /^([2-5]\d)|60$/

    //传真
    jQuery.validator.addMethod("fax",function(value,element){
        var fax = /^(\d{3,4})?[-]?\d{7,8}$/;
        return this.optional(element) || (fax.test(value));
    },"传真格式如：0371-68787027");

    //验证当前值和目标val的值相等 相等返回为 false
    jQuery.validator.addMethod("equalTo2",function(value, element){
        var returnVal = true;
        var id = $(element).attr("data-rule-equalto2");
        var targetVal = $(id).val();
        if(value === targetVal){
            returnVal = false;
        }
        return returnVal;
    },"不能和原始密码相同");

    //大于指定数
    jQuery.validator.addMethod("gt",function(value, element){
        var returnVal = false;
        var gt = $(element).data("gt");
        if(value > gt && value != ""){
            returnVal = true;
        }
        return returnVal;
    },"不能小于0 或空");
    
    //汉字
    jQuery.validator.addMethod("chinese", function (value, element) {
        var chinese = /^[\u4E00-\u9FFF]+$/;
        return this.optional(element) || (chinese.test(value));
    }, "格式不对");

    //指定数字的整数倍
    jQuery.validator.addMethod("times", function (value, element) {
        var returnVal = true;
        var base=$(element).attr('data-rule-times');
        if(value%base!=0){
            returnVal=false;
        }
        return returnVal;
    }, "必须是发布赏金的整数倍");

    //身份证
    jQuery.validator.addMethod("idCard", function (value, element) {
        var isIDCard1=/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;//(15位)
        var isIDCard2=/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;//(18位)

        return this.optional(element) || (isIDCard1.test(value)) || (isIDCard2.test(value));
    }, "格式不对");

    //车牌号
    jQuery.validator.addMethod("carbrand", function (value, element) {
        var carbrand = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
        return this.optional(element) || (carbrand.test(value));
    }, "请输入正确车牌号");

</script>
